package com.inf.vo;

import java.io.Serializable;


/**
 * Created by zhangbn on 2018/10/29.
 */
public class BaseVo implements Serializable {

    private static final long serialVersionUID = 1L;

    private String uuid;
    private String pass_id;
    private String pass_time;
    private String camera_id;
    private Double quality_score;
    private String face_img_url;
    private String feature;

    public BaseVo() {
    }

    public BaseVo(String uuid, String pass_id, String pass_time, String camera_id, Double quality_score, String face_img_url) {
        this.uuid = uuid;
        this.pass_id = pass_id;
        this.pass_time = pass_time;
        this.camera_id = camera_id;
        this.quality_score = quality_score;
        this.face_img_url = face_img_url;
    }

    public BaseVo(String uuid, String pass_id, String pass_time, String camera_id, Double quality_score, String face_img_url, String feature) {
        this.uuid = uuid;
        this.pass_id = pass_id;
        this.pass_time = pass_time;
        this.camera_id = camera_id;
        this.quality_score = quality_score;
        this.face_img_url = face_img_url;
        this.feature = feature;
    }

    public String getUuid() {
        return uuid;
    }

    public void setUuid(String uuid) {
        this.uuid = uuid;
    }

    public String getPass_id() {
        return pass_id;
    }

    public void setPass_id(String pass_id) {
        this.pass_id = pass_id;
    }

    public String getFeature() {
        return feature;
    }

    public void setFeature(String feature) {
        this.feature = feature;
    }

    public Double getQuality_score() {
        return quality_score;
    }

    public void setQuality_score(Double quality_score) {
        this.quality_score = quality_score;
    }

    public String getFace_img_url() {
        return face_img_url;
    }

    public void setFace_img_url(String face_img_url) {
        this.face_img_url = face_img_url;
    }

    public String getPass_time() {
        return pass_time;
    }

    public void setPass_time(String pass_time) {
        this.pass_time = pass_time;
    }

    public String getCamera_id() {
        return camera_id;
    }

    public void setCamera_id(String camera_id) {
        this.camera_id = camera_id;
    }

    @Override
    public String toString() {
        return "BaseVo{" +
                "uuid='" + uuid + '\'' +
                ", pass_id='" + pass_id + '\'' +
                ", feature='" + feature + '\'' +
                ", quality_score=" + quality_score +
                ", face_img_url='" + face_img_url + '\'' +
                ", pass_time='" + pass_time + '\'' +
                ", camera_id='" + camera_id + '\'' +
                '}';
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) return true;
        if (obj == null || getClass() != obj.getClass()) {
            return false;
        }
        BaseVo p = (BaseVo) obj;
        if (uuid.length() == 44) {
            if (p.getUuid().length() == 44) {
                if (uuid.substring(12).equals(p.getUuid().substring(12))) {
                    return true;
                }
            } else if (p.getUuid().length() == 32) {
                if (uuid.substring(12).equals(p.getUuid())) {
                    return true;
                }
            } else {
                return false;
            }
        }
        if (uuid.length() == 32) {
            if (p.getUuid().length() == 32) {
                if (uuid.equals(p.getUuid())) {
                    return true;
                }
            } else if (p.getUuid().length() == 44) {
                if (uuid.equals(p.getUuid().substring(12))) {
                    return true;
                }
            } else {
                return false;
            }
        }
        if (uuid.equals(p.getUuid())) {
            return true;
        }
        return false;
    }

    @Override
    public int hashCode() {
        if (uuid.length() == 44) {
            return uuid.substring(12).hashCode();
        }
        return uuid.hashCode();
    }
}
